package vip.meeet.jdk.mem;

import java.util.ArrayList;

/**
 * -Xms20m -Xmx20m
 * -XX:+HeapDumpOnOutOfMemoryError
 * -XX:HeapDumpPath=/tmp/heapdump.hprof
 * -XX:OnOutOfMemoryError="sh ~/mem_outof_error.sh"
 */
public class HeapOOM {

    static class OOMObject{

    }

    public static void main(String[] args) {
        ArrayList<OOMObject> list = new ArrayList<>();
        while (true) {
            list.add(new OOMObject());
        }
    }
}
